package ejb.entity;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the forecasts database table.
 * 
 */
@Entity
@Table(name="forecasts")
@NamedQueries({
	@NamedQuery(name="DefaultForecast.findAll", query="SELECT fc FROM DefaultForecast fc"),
	@NamedQuery(name="DefaultForecast.findForCityAndDay", query="SELECT fc FROM DefaultForecast fc WHERE fc.city = :city AND fc.plusday = :plusday")
})
public class DefaultForecast implements Serializable, Forecast {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;
	
	@ManyToOne(targetEntity=DefaultCity.class)
	@JoinColumn(name="city_id")
	private City city;

	private int conditions;

	private int plusday;

	private float temperature;

    public DefaultForecast() {
    }

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#getId()
	 */
	@Override
	public int getId() {
		return this.id;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#setId(int)
	 */
	@Override
	public void setId(int id) {
		this.id = id;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#getConditions()
	 */
	@Override
	public int getConditions() {
		return this.conditions;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#setConditions(int)
	 */
	@Override
	public void setConditions(int conditions) {
		this.conditions = conditions;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#getPlusday()
	 */
	@Override
	public int getPlusday() {
		return this.plusday;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#setPlusday(byte)
	 */
	@Override
	public void setPlusday(int plusday) {
		this.plusday = plusday;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#getTemperature()
	 */
	@Override
	public float getTemperature() {
		return this.temperature;
	}

	/* (non-Javadoc)
	 * @see ejb.entity.Forecast#setTemperature(float)
	 */
	@Override
	public void setTemperature(float temperature) {
		this.temperature = temperature;
	}

	@Override
	public City getCity() {
		return city;
	}

	@Override
	public void setCity(City city) {
		this.city = city;
	}

}